set(formic_dir_for_this_test ${FORMIC_BINARY_DIR}/Testing/tests/h4_631g_lm)

file(MAKE_DIRECTORY ${formic_dir_for_this_test})

if (USE_PSI3)

  configure_file(input.dat ${formic_dir_for_this_test}/input.dat COPYONLY)

  add_test(NAME h4_631g_lm_psi3
           WORKING_DIRECTORY ${formic_dir_for_this_test}
           COMMAND ${PSI3_EXE} input.dat
          )

  add_test(NAME h4_631g_lm_check_psi3
           WORKING_DIRECTORY ${formic_dir_for_this_test}
           COMMAND test_checker -compare_float "psi3 scf energy"
                                               output.dat
                                               "SCF total energy   ="
                                               -1
                                               -2.188928720406
                                               1.0e-9
          )

endif (USE_PSI3)

configure_file(input.txt ${formic_dir_for_this_test}/input.txt COPYONLY)
configure_file(h4_ints.txt ${formic_dir_for_this_test}/h4_ints.txt COPYONLY)

add_test(NAME h4_631g_lm_fqmc
         WORKING_DIRECTORY ${formic_dir_for_this_test}
         COMMAND fqmc input.txt output.txt
        )

set(h4_631g_fci_energy "-2.252972")
add_test(NAME h4_631g_lm_check_fqmc
         WORKING_DIRECTORY ${formic_dir_for_this_test}
         COMMAND test_checker -compare_float "fqmc scf hartree fock energy"
                                             output.txt
                                             "Hartree Fock energy ="
                                             0
                                             -2.188928720406
                                             1.0e-9
                              -compare_float "fqmc exact sampling guess energy"
                                             output.txt
                                             "mean ="
                                             0
                                             -2.196940321907
                                             1.0e-9
                              -compare_float "fqmc qmc guess energy"
                                             output.txt
                                             "mean ="
                                             1
                                             -2.199011537920
                                             1.0e-9
                              -compare_float "fqmc exact sampling optimized energy"
                                             output.txt
                                             "mean ="
                                             -1
                                             ${h4_631g_fci_energy}
                                             3.0e-5
        )
unset(h4_631g_fci_energy)

unset(formic_dir_for_this_test)
